package com.zengguang.testkaoshi.tool;

/**
 *返回类型所调用的方法
 */


public class Result {
    public static ResponseMessage success(String message){
        return new ResponseMessage(ResponseMeaaageCodeEnum.SUCCESS.getCode(),message,true);
    }
    public static <T> ResponseMessage<T> success(String code,T data){
        return new ResponseMessage(code,"",data,true);
    }
    public static <T> ResponseMessage<T> success(String code,String message){
        return new ResponseMessage(code,message);
    }
    public static <T> ResponseMessage<T> success(String code,String message,T data,boolean ok){
        return new ResponseMessage(code,message,data,ok);
    }
    public static <T> ResponseMessage<T> success(T data){
        return new ResponseMessage(ResponseMeaaageCodeEnum.SUCCESS.getCode(),"",data,true);
    }

    public static ResponseMessage error(String message) {
        return new ResponseMessage(ResponseMeaaageCodeEnum.ERROR.getCode(), message, false);
    }
    public static <T> ResponseMessage<T> error(String code,T data){
        return new ResponseMessage(code,"",data,false);
    }
    public static <T> ResponseMessage<T> error(String code,String message){
        return new ResponseMessage(code,message);
    }
    public static <T> ResponseMessage<T> error(String code,String message,T data,boolean ok){
        return new ResponseMessage(code,message,data,ok);
    }
    public static <T> ResponseMessage<T> error(T data){
        return new ResponseMessage(ResponseMeaaageCodeEnum.ERROR.getCode(),"",data,false);
    }

    /*
    *  public static ResponseMessage error(String message){
        return new ResponseMessage(ResponseMeaaageCodeEnum.SUCCESS.getCode(),message,true);
    }
    public static <T> ResponseMessage<T> success(String code,T data){
        return new ResponseMessage(code,"",data,true);
    }
    public static <T> ResponseMessage<T> success(String code,String message){
        return new ResponseMessage(code,message);
    }
    public static <T> ResponseMessage<T> success(String code,String message,T data,boolean ok){
        return new ResponseMessage(code,message,data,ok);
    }
    public static <T> ResponseMessage<T> success(T data){
        return new ResponseMessage(ResponseMeaaageCodeEnum.SUCCESS.getCode(),"",data,true);
    }*/




}
